﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace JiveMessenger.Models
{
    public class JiveFriendsGroupModel : INotifyPropertyChanged,IChatGroup
    {
        public string ID { get; private set; }



        private int _memberCount;
        public int MemberCount
        {
            get { return _memberCount; }
            set
            {
                if (_memberCount != value)
                {
                    _memberCount = value;
                    RaisePropertyChanged("MemberCount");
                }
            }
        }

        private bool _isExpanded;
        public bool IsExpanded
        {
            get { return _isExpanded; }
            set
            {
                if (_isExpanded != value)
                {
                    _isExpanded = value;
                    RaisePropertyChanged("IsExpanded");
                }
            }
        }


        private string _name;
        public string Name
        {
            get { return _name; }
            set
            {
                if (_name != value)
                {
                    _name = value;
                    RaisePropertyChanged("Name");
                }
            }
        }


        public GroupType Type
        {
            get { return GroupType.JiveFriendsGroup; }
        }
        public JiveFriendsGroupModel(string id,string name)
        {
            this.ID = id;//Guid.NewGuid().ToString();
            this.Name = name;
        }
        protected void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
        public event PropertyChangedEventHandler PropertyChanged;

    }
}
